Passing Data Between Tasks
In this section you will add another task to your automation and pass variable data to it.
Note: This section uses the Gen1 Automation Builder canvas.
Prepare the Canvas
Let's prepare the workflow canvas by adding another task.
Go back to the Automation Studio tab.
- If you closed the application tab, simply go to the IAP home screen and click the Automation Studio menu option from the left navigation menu.
- Select Find an Automation and search for the "EnlightenMe" automation you created previously.
Click the green transition line between the FetchFact and End tasks.
Either press the "delete" button on your keyboard, or click the trashcan icon in the upper-right corner of the canvas to delete the green transition line.
In the Task Menu Sidebar, search for "Query" and add it to your canvas.
Add a transition between the FetchFact and Query tasks, and then add another between the Query and End tasks.
You should now have four different (yet connected) tasks on your canvas:
START
FetchFact
Query
END
Figure 1. Add Query Task
Configure the Query Task
Next, let's configure the variable information.
Double-click the Query task to open the configuration window for it.
Change the Summary field to read "IsolateFact".
Change the Description field to read "Just give me the fact".
For this example, set the Reference variable for pass_on_null to
False
. This tells the automation to "fail" the task in Job Manager if no value is provided.Set the
query
Reference variable tovalue.joke
.- For this step, go back to the Job Manager tab you left open. Refer to the
response
variable in the OUTGOING tab of the Task History. The response was provided in the form of a JSON object. - In the JASONPath syntax of the
response
, find wherevalue.joke
exists as a key-value pair.
Note: For more information on JSONPath syntax, we recommend reading JSONPath-XPath for JSON. We also recommend the JSONPath Online Evaluator when experimenting with JSONPath data extraction.
- For this step, go back to the Job Manager tab you left open. Refer to the
Change the
obj
Reference task from "static" toFetchFact
and accept the defaultresponse
that displays. This indicates the data you want to search will be provided by the results of the FetchFact task.Click SAVE (lower-left corner) to close the Query task configuration window.
Click SAVE on the workflow canvas to save the entire automation.
Hover over the Query task to show the tooltip "Just give me the fact".
Run the Automation
To test run the automation:
Go to the upper-right corner of the canvas, click the blue play arrow (►) to the right of the Automation Name. A modal window will open.
Click the START button in the left corner of the modal. A new Run Automation modal window will appear in the center of the screen indicating that the job has run.
Within the Run Automation modal window, there's a link that reads VIEW JOB. Once you click the link, a new tab opens in your browser. This new tab displays the Job Manager view of the running job you just started.
Find the name of the job you initiated in the list and click on it. The job view will open.
This time, two tasks are displayed:
IsolateFact
FetchFact
Figure 2. Job Manager Details
Click the book icon at the end of the IsolateFact task.
The Outgoing tab in the Task History reveals the value of the
return_data
variable, indicating that you successfully isolated the incoming fact from the data that was returned by the Query task.Figure 3. Outgoing Task History
Summary Wrap-Up
Congratulations on completing this segment of the tour! By now, you should know how to:
- Build an automation.
- Pass variable data between tasks in an automation.
- Use the Query task.
In the next section, you will learn how to customize the input values.